package com.imu.purse.modules.trade.dao;

import java.util.List;
import org.apache.ibatis.annotations.Select;
import com.imu.purse.modules.trade.entity.YmbDetailEntity;
import com.imu.core.base.BaseMapper;

/**
 * 易买宝充值详情表
 * @author sunhongwei
 * @email sunhongwei@jshijian.com
 * @date 2018-07-02 23:47:18
 * Copyright (c) 2017 武汉极时间科技有限公司 版权所有 
 * Jshijian aloha CO.,LTD. All Rights Reserved. 
 */
public interface YmbDetailMapper extends BaseMapper<YmbDetailEntity>
{
	/**
     * 分页查询
     * @return
     */
	@Select({
		"<script>",
		    "SELECT id,",
					"user_id, ",
					"money, ",
					"card_no, ",
					"phone, ",
					"order_state, ",
					"description, ",
					"create_time, ",
					"update_time",
		    "FROM imu_ymb_detail ",
		    "WHERE 1 = 1",
			"<when test = 'userId != null'>",
		    	"AND `user_id` = #{userId}",
		    "</when>",
			"<when test = 'money != null'>",
		    	"AND `money` = #{money}",
		    "</when>",
			"<when test = 'orderState != null'>",
		    	"AND `order_state` = #{orderState}",
		    "</when>",
			"<when test = 'description != null'>",
		    	"AND `description` = #{description}",
		    "</when>",
			"<when test = 'createTime != null'>",
		    	"AND `create_time` = #{createTime}",
		    "</when>",
			"<when test = 'updateTime != null'>",
		    	"AND `update_time` = #{updateTime}",
		    "</when>",
		    "ORDER BY create_time DESC",
    	"</script>"
	})
    public List<YmbDetailEntity> findByPage(final YmbDetailEntity entity);	
}
